package com.yjy.controller;

import org.springframework.asm.ClassWriter;
import org.springframework.asm.MethodVisitor;
import org.springframework.asm.Opcodes;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class TestController {

    @GetMapping("/test")
    public String test() {
        List<Object> list = new ArrayList<>();
        while (true) {
            list.add(new Object());
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }

    @GetMapping("/createClasses")
    public void createClasses() {
        Metaspace.createClasses();
    }

}
